home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form fOutline
- BackColor = &H00C0C0C0&
- BorderStyle = 3 'Fixed Double
- Caption = "VSFlex Outline"
- ClientHeight = 5490
- ClientLeft = 390
- ClientTop = 990
- ClientWidth = 8040
- Height = 5895
- Left = 330
- LinkTopic = "Form1"
- ScaleHeight = 5490
- ScaleWidth = 8040
- Top = 645
- Width = 8160
- Begin CommandButton Command1
- BackColor = &H00C0C0C0&
- Caption = "Hint"
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "MS Sans Serif"
- FontSize = 8.25
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- Height = 300
- Left = 6315
- TabIndex = 2
- Top = 5025
- Width = 1185
- End
- Begin vsFlexArray fa
- BackColor = &H0080FFFF&
- BackColorBkg = &H0080FFFF&
- BackColorFixed = &H00C0C0C0&
- BorderStyle = 0 'None
- Cols = 4
- FillStyle = 1 'Repeat
- FixedCols = 0
- FocusRect = 0 'None
- FontBold = 0 'False
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 13.5
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00000000&
- FormatString = "^ |Description |>Date |>Amount "
- GridLines = 0 'None
- Height = 4035
- HighLight = 0 'Never
- Left = 180
- SelectionMode = 1 'By Row
- TabIndex = 0
- Top = 855
- Width = 7575
- End
- Begin Label Label1
- Alignment = 2 'Center
- BackColor = &H00000000&
- Caption = "Travel Expense Outline"
- FontBold = -1 'True
- FontItalic = 0 'False
- FontName = "Arial"
- FontSize = 24
- FontStrikethru = 0 'False
- FontUnderline = 0 'False
- ForeColor = &H00FFFF00&
- Height = 615
- Left = 225
- TabIndex = 1
- Top = 120
- Width = 7485
- End
- Option Explicit
- ' Demo Goals
- Sub Command1_Click ()
- MsgBox "Double-click on the category line to collapse or expand the items"
- End Sub
- Sub DoFillData ()
- Dim t$, s$, tot%
- t = Chr(9)
- fa.Rows = 1
- fa.AddItem "*" + t + "Air Fare"
- fa.AddItem "" + t + "SFO-JFK" + t + "April 14" + t + Format$(Rnd * 500, "###.00")
- fa.AddItem "" + t + "JFK-JFK" + t + "April 18" + t + Format$(Rnd * 500, "###.00")
- fa.AddItem "" + t + "SFO-OAK" + t + "April 24" + t + Format$(Rnd * 500, "###.00")
- fa.AddItem "" + t + "OAK-SFO" + t + "April 27" + t + Format$(Rnd * 500, "###.00")
- fa.AddItem "*" + t + "Meals"
- fa.AddItem "" + t + "Bad service BBQ" + t + "April 14" + t + "35.00"
- fa.AddItem "" + t + "The flying dish" + t + "April 15" + t + "135.00"
- fa.AddItem "" + t + "Indigestion Cafe" + t + "April 17" + t + "45.00"
- fa.AddItem "*" + t + "Hotel"
- fa.AddItem "" + t + "Bates Motel" + t + "April 14" + t + "817.00"
- fa.AddItem "" + t + "Nightmare Inn" + t + "April 15" + t + "117.00"
- fa.AddItem "" + t + "Rats & Breakfast" + t + "April 25" + t + "17.00"
- End Sub
- Sub DoTotals ()
- Dim i%, tot%
- For i = fa.Rows - 1 To 0 Step -1
- If fa.TextArray(i * fa.Cols) = "" Then
- tot = tot + Val(fa.TextArray(i * fa.Cols + 3))
- Else
- fa.Row = i
- fa.Col = 0
- fa.ColSel = fa.Cols - 1
- fa.CellBackColor = 1 ' black
- fa.CellForeColor = &HFFFF& ' yellow
- fa.CellFontBold = True
- fa.CellFontWidth = 8
- fa.TextArray(i * fa.Cols + 3) = Format(tot, "##.00")
- tot = 0
- End If
- Next
- End Sub
- Sub fa_DblClick ()
- Dim i%, r%
- ' find field to collapse or expand
- r = fa.MouseRow
- If r < 1 Then Exit Sub
- While r > 0 And fa.TextArray(r * fa.Cols) = ""
- r = r - 1
- Wend
- ' show symbol
- If fa.TextArray(r * fa.Cols) = "*" Then
- fa.TextArray(r * fa.Cols) = "+"
- Else
- fa.TextArray(r * fa.Cols) = "*"
- End If
- ' collapse this guy
- r = r + 1
- If fa.RowHeight(r) = 0 Then
- While r < fa.Rows - 1 And fa.TextArray(r * fa.Cols) = ""
- fa.RowHeight(r) = -1
- r = r + 1
- Wend
- If r = fa.Rows - 1 And fa.TextArray(r * fa.Cols) = "" Then fa.RowHeight(r) = -1
- Else
- While r < fa.Rows - 1 And fa.TextArray(r * fa.Cols) = ""
- fa.RowHeight(r) = 0
- r = r + 1
- Wend
- If r = fa.Rows - 1 And fa.TextArray(r * fa.Cols) = "" Then fa.RowHeight(r) = 0
- End If
- End Sub
- Sub Form_Load ()
- DoFillData
- DoTotals
- fa.Col = 1
- fa.Row = 1
- fa.ColSel = fa.Cols - 1
- End Sub
- Sub Form_Resize ()
- ' Dim sz!
- ' sz = scalewidth - 2 * fa.Left
- ' If sz > 0 Then fa.Width = sz
- ' sz = scaleheight - fa.Top - fa.Left
- ' If sz > 0 Then fa.Height = sz
- End Sub
-